package com.kgc.entity;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;

public class User {
    private Integer id;
    private String username;
    private String password;
    private String phone;
    private String email;
    private Integer sex;

    private List<UserCar> userCarList; // 车位集合
    private String carName; // 车位名称

    private List<UserRoom> userRoomList; // 房屋集合
    private String roomName; // 房屋名称

    private Integer status;
    @JSONField(serialize = false)
    private String salt;

    public User() {
    }

    public User(String username, String phone, Integer sex) {
        this.username = username;
        this.phone = phone;
        this.sex = sex;
    }

    public User(Integer id, String username, String phone, Integer sex) {
        this.id = id;
        this.username = username;
        this.phone = phone;
        this.sex = sex;
    }

    public User(Integer id, String username, String phone, Integer sex, String carName, String roomName) {
        this.id = id;
        this.username = username;
        this.phone = phone;
        this.sex = sex;
        this.carName = carName;
        this.roomName = roomName;
    }

    public User(String username, String password, String phone, String email, Integer sex, Integer status, String salt) {
        this.username = username;
        this.password = password;
        this.phone = phone;
        this.email = email;
        this.sex = sex;
        this.status = status;
        this.salt = salt;
    }

    public User(Integer id, String username, String password, String phone, String email, Integer sex, Integer status, String salt) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.phone = phone;
        this.email = email;
        this.sex = sex;
        this.status = status;
        this.salt = salt;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username == null ? null : username.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getSalt() {
        return salt;
    }

    public List<UserCar> getUserCarList() {
        return userCarList;
    }

    public void setUserCarList(List<UserCar> userCarList) {
        this.userCarList = userCarList;
    }

    public String getCarName() {
        return carName;
    }

    public void setCarName(String carName) {
        this.carName = carName;
    }

    public List<UserRoom> getUserRoomList() {
        return userRoomList;
    }

    public void setUserRoomList(List<UserRoom> userRoomList) {
        this.userRoomList = userRoomList;
    }

    public String getRoomName() {
        return roomName;
    }

    public void setRoomName(String roomName) {
        this.roomName = roomName;
    }

    public void setSalt(String salt) {
        this.salt = salt == null ? null : salt.trim();
    }
}